import request from "@/utils/request";



// 添加购物和
export function add(uid){
    const data = {
        uid
    }
    return request({
        url:'/headerTop/list/add',
        method: 'post',
        data : data
    })
}

//登陆后购物车信息
export function selectAll(query){
  return request({
      url:'/headerTop/list/allCart',
      method:'get',
      params:query
  })
}

// 计数器改变
export function updateNumber(amount,id){
    const data ={
        amount,
        id,
    }
    return request({
        url:'/headerTop/list/updateNumber',
        method: 'post',
        data : data
    })
}

// 删除购物车
export function deleteCart(id){
    const data ={
        id
    }
    return request({
        url:'/headerTop/list/deleteCart',
        method: 'post',
        data : data
    })
}

// 添加订单
export function toPay(ids,address_id,){
    const data={
        ids,
        address_id,
    }
    return request({
        url:'/headerTop/list/addOrder',
        method: 'post',
        data : data
    })
}
